home *** CD-ROM | disk | FTP | other *** search
/ Shocking The Web CD-ROM / SHOCK_CD.ISO / pc / tutorial / devglry / zoetek / source / shckclck.dir / 00097_Timezone Routines.ls < prev    next >
Encoding:
Text File  |  1996-04-11  |  906 b   |  47 lines

  1. global away, tzLoc, tzDest, oldLoc, smallnil
  2.  
  3. on timezoneInit
  4.   set oldLoc to 0
  5.   set away to 0
  6.   set tzLoc to 33
  7.   set tzDest to 33
  8. end
  9.  
  10. on tzDisplay
  11.   set the castNum of sprite 17 to the number of cast "r nil" + not away
  12.   set the castNum of sprite 16 to the number of cast "square nil" + away
  13.   if away then
  14.     tzClick(tzDest)
  15.   else
  16.     tzClick(tzLoc)
  17.   end if
  18. end
  19.  
  20. on tzoffset
  21.   gettz(tzLoc)
  22.   set x to the result
  23.   gettz(tzDest)
  24.   return the result - x
  25. end
  26.  
  27. on tzClick loc
  28.   if oldLoc then
  29.     set the blend of sprite oldLoc to 100
  30.   end if
  31.   set oldLoc to loc
  32.   set the blend of sprite oldLoc to 50
  33.   gettz(loc)
  34.   set tz to the result
  35.   set tzs to the number of cast "minus" + (tz > 0)
  36.   if tz = 0 then
  37.     set tzs to the number of cast "alarmoff"
  38.   end if
  39.   set the castNum of sprite 1 to tzs
  40.   donum(2, smallnil, 1, abs(tz))
  41.   updateStage()
  42. end
  43.  
  44. on gettz loc
  45.   return ((loc + 2) mod 24) - 11
  46. end
  47.